<?php

declare(strict_types=1);
/**
 * Created by Vscode
 * User: ChenP
 * Date: 2021-12-03 17:00
 */
namespace App\Controller;

use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\AutoController;
use App\Services\UserService;

/**
 * @AutoController
 */
class UserController extends AbstractController
{
    /**
     * @Inject()
     * @var UserService
     */
    protected $userService;

    public function login()
    {
        $params = $this->validate();

        $data = $this->userService->login($params);

        return $this->send($data);
    }

    public function verify_code()
    {
        $params = $this->validate();

        $data = $this->userService->verifyCode($params);

        return $this->send($data);
    }

    public function user_data()
    {
        // $params = $this->validate();

        $data = $this->userService->userData();

        return $this->send($data);
    }

    //个人中心左侧信息使用
    public function get_user()
    {
        // $params = $this->validate();

        $data = $this->userService->getUser();

        return $this->send($data);
    }

    public function get_user_info()
    {
        // $params = $this->validate();

        $data = $this->userService->getUserInfo();

        return $this->send($data);
    }

    public function sub_user_info()
    {
        $params = $this->validate();

        $data = $this->userService->subUserInfo($params);

        return $this->send($data);
    }

    public function sub_platform_info()
    {
        $params = $this->validate();

        $data = $this->userService->subPlatformInfo($params);

        return $this->send($data);
    }

    public function my_wallet()
    {
        $params = $this->validate();

        $data = $this->userService->myWallet($params);

        return $this->send($data);
    }
}
